<template>
    <section>
        <sy-baselist
                ref="carsapply"
                editVue="./business/Cars_Apply_Edit.vue"
                :filters="filters"
                listUrl="server/business/CarsApply.ashx?cmd=GetList"
                deleteUrl="server/business/CarsApply.ashx?cmd=Delete"
                @onLoadRow="onLoadRow"
        >
            <el-table-column prop="CarsNo" label="车牌号" width="150">
            </el-table-column>
            <el-table-column prop="UserName" align="center"  header-align="center" label="借车人"  width="180" >
            </el-table-column>
            <el-table-column prop="FStartDate" align="center"  header-align="center" label="借车时间"  width="180" >
            </el-table-column>
            <el-table-column prop="FEndDate" align="center"  header-align="center" label="归还时间"  width="180" >
            </el-table-column>
            <el-table-column prop="FNote" label="备注" width="100">
            </el-table-column>
                <template  slot="extendbtn_end" scope="props">
                    <el-button size="small" v-if="!props.row.hidePrint"  @click="Print(props.row)">打印申请表</el-button>
                </template>
        </sy-baselist>
    </section>
</template>

<script>
    import util from '../../common/util'
    export default {
        data(){
            return {
                filters: [{type: "string",name:"CarsNo",text:"车牌号", value: null}]
            }
        },
        methods:{
            onLoadRow(row)
            {
                row.FStartDate = util.date.format(row.FStartDate,'yyyy-MM-dd')
                row.FEndDate = util.date.format(row.FEndDate,'yyyy-MM-dd')
                row.hidePrint=true

            },
        Print(row){
            window.open(global.serverHost+"client/print/printcarsapply.html?FID="+row.FID);
        }
        },
        created(){

       }
    }
</script>